<include file="public@header" />
</head>
<body>
	<div class="wrap">
		<form action="" class="form-horizontal">
			<div class="row">
				<div class="form-group">
					<div class="col-sm-offset-1 col-sm-10">
						<table class="table">
							<thead>
								<tr>
									<th class="col-sm-3">仓库</th>
									<th class="">商品库存</th>
									<th class="">基础运费</th>
								</tr>
							</thead>
							<tbody>
								<volist name="list" id="vo">
									<tr>
										<td>{$vo.storage_name}</td>
										<td><input type="text" name="goods_num" value="{$vo.goods_num}" class="form-control" title="{$vo.goods_id}-{$vo.sid}-goods_num" onchange="setStorage(this)"></td>
										<td><input type="text" name="freight_price" value="{$vo.freight_price}" class="form-control" title="{$vo.goods_id}-{$vo.sid}-freight_price" onchange="setStorage(this)"></td>
									</tr>
								</volist>
							</tbody>
						</table>
					</div>

				</div>
			</div>
		</form>
	</div>
	<script src="__STATIC__/js/admin.js"></script>
	<script type="text/javascript">
		function setStorage(e) {
			console.log(e.title)
			$.ajax({
				url: "stock",    // 提交到controller的url路径
				type: "post",    // 提交方式
				data: {title:e.title, name:e.name, value:e.value},  // data为String类型，必须为 Key/Value 格式。
				dataType: "json",    // 服务器端返回的数据类型
				success: function (data) {
					if (data.code == 1) {
						alert(data.msg);
						window.location.reload();
					} else {
						alert(data.msg);
					}
				},
			});
		}
	</script>
</body>
</html>